Press enter to skip the top menu

Human Computer Interaction

Tables and Databases

Learning Outcomes

On completion of this chapter you will know:

Go to top

Introduction

Although we met a form of database already when we were learning spreadsheets, it was not a proper database in the strictest terms as defined in the IT field. A spreadsheet is designed for the mathematical manipulation of relatively small amount of mainly numeric data, whereas a database is for the storage of large volumes of mainly non numeric data and has very limited capacity for calculations. On the other hand a database has excellent means of validating data and equally excellent reporting facilities, while the spreadsheet has very limited capacities in those two areas.

Go to top

Tables

The most basic unit of a database is a table. A database can have as many tables as are required but in this introductory course we shall look at a database containing only one table. Later on we shall look at multi table databases but to start with we shall be looking at a database containing only one table.

Fig 1: A properly structured table.

A very simple table is shown in Listing 1‑1 above. As you can see it’s a 5X7 grid. At a quick glance we can see that it is a list of people’s names, addresses and ages. The very top row contains the names of the Fields in the table. Those are named Title, Surname, Name, Address and Age. The first row above does not actually form part of the table and is not part of the data stored in the table. It is in fact there as information to explain what is in the columns below it. The actual data starts below it in the row that contains the details about Harry Potter. This entire row is called a Record. A Table can have as many rows as is required. The only limit is the size of the disk that contains the original database. Each Record is made up of Fields. A field is where a row and a column meet. In our case the record is made up of five fields. The names of the fields indicate what type of data is to be stored there. Thus the Title field contains Mr, the Surname field contains Potter, the Name field contains Harry etc.

Although a table can contain as many records as there is space for in the disk, each record must have exactly the same number of fields. We cannot add an extra field to one record and leave the rest unchanged. Of course if we realize that we need extra information about a person such as his date of birth we can add that field to the table – but it will be added to every record in the table, not just to the one record we want.

Go to top

Summary

A table is a logical structure for storing data. The various data items we wish to store are stored in Fields. A number of fields make up a record. The structure of each record must be exactly the same, in other words it must have the same number of fields and in the same order. A table can have as many records as are required and is only limited by the size of the disk on which it is stored.

Go to top

Exercise

  1. Table, field, database, record - put the four words in logical order
  2. A database can contain only one table. True or false?
  3. In a table different records can contain different number of fields. True or false?
  4. The maximum number of records in a table is 1,000. True or false?
  5. In image below list all of the features that are wrong for a table. When finished design a correct version that could become a table.
Go to top